use "C:\Users\shingo\Documents\data\engineroom_TDS-a_publicreleaseCCBY-NC_081013\Egypt file II ver2.dta", clear
reg participate_count Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal
estimate store m1
poisson participate_count Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal
estimate store m2
nbreg participate_count Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal
estimate store m3
estimates stat m*

logit demonstration Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal
estimate store m4
estimates stat m4
relogit demonstration Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal

gen p_count_without_zero=participate_count
replace p_count_without_zero=. if participate_count==0
poisson p_count_without_zero Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal
estimate store m5
nbreg p_count_without_zero Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal
estimate store m6
estimates stat m*


nbreg participate_count Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal
margins, at(Q5B=(1(1)100)) vsquish post
parmest, norestore
gen id=_n
gen POS=id
label var POS "Political Oppotunity"
twoway rarea max95 min95 POS, pstyle(ci) || line estimate POS, ytitle(Count(participation)) title(Predictive marigns with 95% confidence interval) legend(off) 

use "C:\Users\shingo\Documents\data\engineroom_TDS-a_publicreleaseCCBY-NC_081013\Egypt file II ver2.dta", clear
logit demonstration Inequality_gov Q10_14 male D2 D10 politalk Q5B localpaper- Verbal
margins, at(Internet=(1(0.1)6)) vsquish post
parmest, norestore
gen id=_n
gen Internet=1+(id-1)*0.1
label var Internet "Internet"
twoway rarea max95 min95 Internet, pstyle(ci) || line estimate Internet, ytitle(Probability(participation)) title(Predictive marigns with 95% confidence interval) legend(off) 
